package com.openget.lang;
import java.io.*;
import org.w3c.dom.*;
import com.openget.util.*;

public class OpengetDocument {
	
	private Document sourceDocument;
	private OpengetElement opengetElement;
 
	public OpengetDocument(InputStream is) {		
		if(new OpengetValidator(is).validate()) {
			sourceDocument = XmlUtil.createDocument(is);		
			opengetElement = new OpengetElement(sourceDocument.getDocumentElement());
		}
	}
	
	public void execute(OpengetContext context) {
		this.opengetElement.execute(context);
	}
}
